package com.zxx.admin.config.auth.security;//package com.zxx.config.auth.security;
//
//
//import com.zxx.config.auth.user.SecurityUser;
//import com.zxx.entity.sys.SysAdminEntity;
//import org.springframework.security.core.GrantedAuthority;
//import org.springframework.security.core.authority.SimpleGrantedAuthority;
//
//import java.util.List;
//import java.util.stream.Collectors;
//
//public final class SecurityUserFactory {
//
//    private SecurityUserFactory() {
//    }
//
//    public static SecurityUser create(SysAdminEntity admin) {
//        boolean enabled =true;
//        return new SecurityUser(
//                admin.getId(),
//                admin.getUserName(),
//                admin.getPassword(),
//                enabled,
//                mapToGrantedAuthorities(admin.getRoleNames())
//        );
//    }
//
//    private static List<GrantedAuthority> mapToGrantedAuthorities(List<String> authorities) {
//        return authorities.stream()
//                .map(SimpleGrantedAuthority::new)
//                .collect(Collectors.toList());
//    }
//
//}
